package org.groupg.practice.jscience;

import org.jscience.physics.amount.Amount;
import javax.measure.quantity.Energy;
import javax.measure.quantity.Mass;
import static javax.measure.unit.SI.*;

public class PhysicsDemo {
    public static void main(String[] args) {
        // 计算能量 E = mc²（质量 1 kg）
        Amount<Mass> mass = Amount.valueOf(1, KILOGRAM);
        Amount<Energy> energy = mass.times(SPEED_OF_LIGHT.pow(2)).to(JOULE);
        System.out.println("能量 (焦耳): " + energy); // 输出: ~8.98755e16 J
    }
}